Thread: [Win32] Wrapping in_addr in a class

  1. #1
    Codebot
    Join Date
    Jun 2004
    Location
    Toronto
    Posts
    195

    [Win32] Wrapping in_addr in a class

    I'm trying to make a neat wrapper that wraps the IP address structures. However, I'm grappling with how to make the class both IPv4 and IPv6 friendly. Can anyone provide any resources (code snippets, links, etc) that can shed some light on how I may approach my design?

    Thanks!
    Founder and avid member of the Internationsl Typo Associateion

  2. #2
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    2,158
    Just don't use the IPv4 in_addr class. If your wrapper gets passed an IPv4, simply properly load it into the IPv6 class, by taking advantage of it's backwards-compatibility.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help with FIFO QUEUE
    By jackfraust in forum C++ Programming
    Replies: 23
    Last Post: 04-03-2009, 08:17 AM
  2. Class design problem
    By h3ro in forum C++ Programming
    Replies: 10
    Last Post: 12-19-2008, 09:10 AM
  3. matrix class
    By shuo in forum C++ Programming
    Replies: 2
    Last Post: 07-13-2007, 01:03 AM
  4. Replies: 7
    Last Post: 05-26-2005, 10:48 AM